package com.ocom.netty.mj.client;

import com.ocom.common.constant.AiotUrl;
import com.ocom.common.resp.RespMachMessage;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/8/22
 **/
@Component
@FeignClient(name = "aiot")
public interface AiotClient {

	//门禁设备签到
	@GetMapping(AiotUrl.URL_Aiot_SetMjDeviceCommTimeBySign)
	public RespMachMessage setMjDeviceCommTimeBySign(@RequestParam("deviceNo")String deviceNo, @RequestParam("commMode")Integer commMode);


	// 3.2.SaaS平台激活(禁用)设备(SetDeviceStatusBySaas)
	// 3.2.SaaS平台激活(禁用)消费设备(SetXfDeviceStatusBySaas)
	@PostMapping(AiotUrl.Url_Aiot_SetMjDeviceStatusBySaas)
	public Result SetMjDeviceStatusBySaas(@Validated @RequestBody Map<String,Object> map);


	// 3.5.门禁设备获取升级版本信息（getMjDeviceVersion）
	@GetMapping(value = AiotUrl.URL_Aiot_GetMjDeviceVersion)
	RespMachMessage GetMjDeviceVersion(@RequestParam("deviceNo") String deviceNo, @RequestParam("versionCode") String versionCode,@RequestParam("commMode")  Integer commMode);


	// 更改升级文件数据状态（changeBinDataState）
	@PostMapping(AiotUrl.URLP_AIOT_changeBinDataState)
	public RespMachMessage changeBinDataState(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("jobId") Integer jobId);

	@PostMapping(AiotUrl.URLP_AIOT_getBinData)
	public RespMachMessage getBinData(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("lastBlockNum") Integer lastBlockNum);
}
